/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.daemonna.fluentlee_core.repair;

import com.daemonna.fluentlee_core.reporting.HTMLprocessor;
import java.io.File;

/**
 *
 * @author daemonna
 */
public class reports_repair {
    
    public reports_repair() {
        File indexf = new File("reports/template_report.html");
        
        if (indexf.exists()) {
        } else {
            repair_reports_folder();
        }
    }

    private void repair_reports_folder() {
        System.out.println("reports folder corrupted... REPAIRING");
        try {
            
            new File("reports").mkdir();
            
            String[] vals = {"maintanance", "try later"};
            
            HTMLprocessor html = new HTMLprocessor("reports/template_report.html");
            html.write_HEAD("template report");
            html.start_table(600);
            html.write_table_header(vals);
            html.end_table();
            html.write_FOOT();
        } catch (Exception e) {//Catch exception if any
            System.err.println("Error: " + e.getMessage());
        }
    }
}
